package com.shiyun.marker.cli.example;

import picocli.CommandLine;
import picocli.CommandLine.Option;

import java.util.concurrent.Callable;

public class Login implements Callable<Integer> {
    @Option(names={"-u","--user"},description="user name")
    String user;
    @Option(names={"-p","--password"}, description = "password",interactive = true)
    String password;

    @Override
    public Integer call() throws Exception {
        System.out.println("password = " + password);
        return 0;
    }

    public static void main(String[] args) {
        new CommandLine(new Login()).execute("-u","user123","-p");
    }
}
